package com.zero.controller;

import com.sun.org.apache.regexp.internal.RE;
import com.zero.service.AssetsDebtService;
import com.zero.service.StatisticService;
import com.zero.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/statistic")
public class StatisticController {

    @Autowired
    private AssetsDebtService assetsDebtService;

    @Autowired
    private StatisticService statisticService;

//    @GetMapping("/assetsDebtTrend")
//    public Result getAssetsDebtTrend(HttpServletRequest request){
//        return assetsDebtService.getRecentData(request);
//    }
//
    @GetMapping("/assetsDebt")
    public Result getAssetsDebt(HttpServletRequest request){
        return assetsDebtService.getAssetsDebt(request);
    }

    @PostMapping("/byYear")
    public Result getStatisticByYear(@RequestBody Map map, HttpServletRequest request){
        return statisticService.getStatisticByYear(map, request);
    }

    @PostMapping("/recentFiveYear")
    public Result getRecentFiveYear(@RequestBody Map map, HttpServletRequest request){
        return statisticService.getRecentFiveYear(map, request);
    }

    @PostMapping("/quarterData")
    public Result getQuarterData(@RequestBody Map map, HttpServletRequest request){
        return statisticService.getQuarterData(map, request);
    }

    @PostMapping("/quarterContrast")
    public Result getQuarterContrast(@RequestBody Map map, HttpServletRequest request){
        return statisticService.getQuarterContrast(map, request);
    }

    @PostMapping("/monthData")
    public Result getMonthData(@RequestBody Map map, HttpServletRequest request){
        return statisticService.getMonthData(map, request);
    }

    @GetMapping("/todayData")
    public Result getTodayData(HttpServletRequest request){
        return statisticService.getTodayData(request);
    }


}
